package com.example.jbmsuppliers.sinopec.adapter;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.example.jbmsuppliers.R;

import java.util.ArrayList;

/**
 * Created by 家帮忙 on 2016/10/9.
 */

public class Order_XQ_Adapter extends BaseAdapter {

    Context c;
    ArrayList<Bitmap> arrbitmap;

    public Order_XQ_Adapter(Context c, ArrayList<Bitmap> arrbitmap) {
        this.c = c;
        this.arrbitmap = arrbitmap;
    }

    @Override
    public int getCount() {
        return arrbitmap.size();
    }

    @Override
    public Object getItem(int i) {
        return arrbitmap.get(i);
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        if (view==null){
           view= View.inflate(c, R.layout.item_recyl_photo_image,null);
        }
        ImageView imager = (ImageView) view.findViewById(R.id.selectImg);
        imager.setImageBitmap(arrbitmap.get(i));

        return view;
    }
}
